﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminSite.Master" AutoEventWireup="true" CodeBehind="StockOrderDetails.aspx.cs" Inherits="Agents.Admin.StockOrderDetails" %>
<asp:Content ID="Header" ContentPlaceHolderID="Header" runat="server">
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
    <h1>פרטי הזמנה <%= Request.Params["stockOrderID"] %></h1>           
    <hr />       
    <asp:DataGrid runat="server" ID="dgProducts" AutoGenerateColumns="False"
        AllowPaging="True" PageSize="12" PagerStyle-Mode="NumericPages" 
        DataSourceID="SqlDataSource1" BackColor="White" BorderStyle="None" 
        CellPadding="3" GridLines="Both"
        onpageindexchanged="dgProducts_PageIndexChanged" CssClass="dataGrid" 
        Font-Names="Verdana" BorderColor="#999999" BorderWidth="1px">
        <AlternatingItemStyle BackColor="#DCDCDC" />
        <Columns>
            <asp:BoundColumn DataField="Name" HeaderText="מוצר" />
            <asp:BoundColumn DataField="ItemsNum" HeaderText="פריטים שהוזמנו" />
        </Columns>
        <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
        <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
        <ItemStyle BackColor="White" ForeColor="Black" />
        <PagerStyle Mode="NumericPages" BackColor="#999999" ForeColor="Black" HorizontalAlign="Center"></PagerStyle>
        <SelectedItemStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
    </asp:DataGrid>
                
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AgentConnectionString %>" 
        SelectCommand="SELECT Name, ItemsNum FROM StockOrdersProducts JOIN Products
            ON (StockOrdersProducts.ProductId = Products.Id) WHERE (StockOrdersProducts.StockOrderId = @stockOrderId) ORDER BY Name">
            <SelectParameters>
                <asp:QueryStringParameter QueryStringField="stockOrderId" Name="stockOrderId" />
            </SelectParameters>
    </asp:SqlDataSource>
    <br />           
    <hr />
    <div class="alignCenter">               
        <asp:Button ID="backBtn" Text="חזור" runat="server" onclick="backBtn_Click" CssClass="button"/>
    </div>
</asp:Content>
